import JSEncrypt from 'jsencrypt/bin/jsencrypt'

const publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgHs7Yxp4ni1mpF5KA/ERsn6DiBWRPaIbI0y7COvhmTnyBEL4qiqsXujpcGaTot2RbiF3x/pUoR2crWcslVFYfUYxyKcuT0XutRHy+aNq4KyJ+k03WCwaQbQtyzv4zD6YMwFiVJfEpEc45ewoc21W80j/6/XUVG2DS75MJrd+fLwIDAQAB'

// 加密
export function encrypt(txt) {
  const encryptor = new JSEncrypt()
  encryptor.setPublicKey(publicKey) // 设置公钥
  return encryptor.encrypt(txt) // 对需要加密的数据进行加密
}

